﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LiChengCWJK.aspx.cs" Inherits="Web.Pages.YongShui._6.ZhangWuGL.LiChengCWJK" Theme="Default" ValidateRequest="false" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="../../../JS/jquery.js" type="text/javascript"></script>
    <script src="../../../JS/AddEditCancel.js" type="text/javascript"></script>
    <script type="text/javascript">
        function EmptyCheck(obj) {
            if (obj.GetText() == "") {
                alert("账务年月不能为空");
                obj.Focus();
            }
        }

        function rowClick() {
            if (gvtab1.GetFocusedRowIndex() != -1) {
                hdCollection.Set("index", gvtab1.GetFocusedRowIndex());
                ASPxCallback1.PerformCallback("pzmx");
            }
        }

        function ASPxCallback1Complete(rs) {
            var arr = rs.split('|');
            var type = arr[0];
            var state = arr[1];
            if (type == "pzmx") {
                hdCollection.Set("bh", arr[2]);
                hdCollection.Set("name", arr[3]);
                gvtab2.PerformCallback();
            }
            
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="tabletitle1" align="center">
            立成财务接口
        </div>
        <div style="display: none;">
            <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
            <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
        </div> 
        <asp:UpdatePanel ID="updatePanel1" runat="server">
            <ContentTemplate>
                <div>
                    <div>
                        <table style="text-align: left; width: 100%;">
                            <tr>
                                <td style="float: left;"><span style="font-size: 12px;">账务年月：</span></td>
                                <td style="float: left;">
                                    <dx:ASPxTextBox ID="txtZhangWuNY" Width="60%" runat="server" Enabled="true" ClientInstanceName="txtZhangWuNY">
                                        <ClientSideEvents KeyUp="function(s,e){inputNum(s);}"  LostFocus="function(s,e){EmptyCheck(s);}"/>
                                    </dx:ASPxTextBox>
                                </td>
                                <td style="width:30%;">&nbsp;</td>
                                <td>
                                    <dx:ASPxButton ID="btnShengChengSJ" runat="server" Text="生成数据" OnClick="btnShengChengSJ_Click" UseSubmitBehavior="true">
                                    </dx:ASPxButton>
                                </td>
                                <td>
                                    <dx:ASPxButton ID="btnDaoRuDXSSJ" runat="server" Text="导入地下水数据" OnClick="btnDaoRuDXSSJ_Click" UseSubmitBehavior="false">
                                    </dx:ASPxButton>
                                </td>
                                <td>
                                    <dx:ASPxButton ID="btnDaoRuSZYSJ" runat="server" Text="导入水资源数据" OnClick="btnDaoRuSZYSJ_Click" UseSubmitBehavior="false">
                                    </dx:ASPxButton>
                                </td>
                                <td>
                                    <dx:ASPxButton ID="btnDaoRuDLC" runat="server" Text="导入到立成" OnClick="btnDaoRuDLC_Click" UseSubmitBehavior="false">
                                    </dx:ASPxButton>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <hr />
                    <div style="width: 100%;">
                        <div style="float: left; width: 20%;">
                            <fieldset>
                                <%--style="border: 1px solid #a3c0e8;"--%>
                                <legend>凭证信息</legend>
                                <dx:ASPxGridView ID="gvPingZhengXX" runat="server" AutoGenerateColumns="False" KeyFieldName="BIANHAO" Theme="Aqua1" Width="100%" EnableCallBacks="false"
                                      ClientInstanceName="gvtab1">
                                    <Columns>
                                        <dx:GridViewDataTextColumn FieldName="BIANHAO" Caption="凭证连续编号" Width="50%">
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="NAME" Caption="凭证类型" Width="50%">
                                        </dx:GridViewDataTextColumn>
                                    </Columns>
                                    <Settings VerticalScrollableHeight="300" VerticalScrollBarMode="Auto" HorizontalScrollBarMode="Auto" />
                                    <ClientSideEvents FocusedRowChanged="function(s,e){rowClick();}" />
                                </dx:ASPxGridView>
                            </fieldset>
                        </div>
                        <div style="float: right; width: 80%;">
                            <fieldset>
                                <legend>凭证明细</legend>
                                <dx:ASPxGridView ID="gvPingZhengMX" runat="server" AutoGenerateColumns="False" KeyFieldName="I_PINGZHENGLXBH" Theme="Aqua1" 
                                    Width="100%" OnCustomCallback="gvPingZhengMX_CustomCallback" ClientInstanceName="gvtab2">
                                    <Columns>
                                        <dx:GridViewDataTextColumn FieldName="S_GOGNZUONY" Caption="工作年月" Width="8%">
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="I_PINGZHENGLXBH" Caption="凭证连续编号" Width="12%">
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="I_FENLUSXH" Caption="分录顺序号" Width="10%">
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="I_SHOUFUZJLX" Caption="收付转记类型" Width="12%">
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="I_XIANYINZJLX" Caption="现银转记类型" Width="12%">
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="S_KEMUDM" Caption="科目代码" Width="8%">
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="N_JIEFANGJE" Caption="借方金额" Width="10%">
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="S_KEHUDM" Caption="客户代码" Width="8%">
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="S_KEHUMC" Caption="客户名称" Width="20%">
                                        </dx:GridViewDataTextColumn>
                                    </Columns>
                                    <Settings VerticalScrollableHeight="300" VerticalScrollBarMode="Auto" HorizontalScrollBarMode="Auto" />
                                </dx:ASPxGridView>
                            </fieldset>
                        </div>
                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
